package com.example.theme_hospital;

public class Diagnosis {
    private String name;
    private int severity;
    private int treatmentTime;
    private boolean isDiagnosed;
    private boolean isTreated;
    
    public Diagnosis(String name, int severity, int treatmentTime) {
        this.name = name;
        this.severity = severity;
        this.treatmentTime = treatmentTime;
        this.isDiagnosed = false;
        this.isTreated = false;
    }
    
    // 诊断病人
    public void diagnose() {
        this.isDiagnosed = true;
    }
    
    // 治疗病人
    public void treat() {
        if (isDiagnosed && treatmentTime > 0) {
            treatmentTime--;
            if (treatmentTime == 0) {
                isTreated = true;
            }
        }
    }
    
    // Getters
    public String getName() {
        return name;
    }
    
    public int getSeverity() {
        return severity;
    }
    
    public int getTreatmentTime() {
        return treatmentTime;
    }
    
    public boolean isDiagnosed() {
        return isDiagnosed;
    }
    
    public boolean isTreated() {
        return isTreated;
    }
}